/*
 *  ATrackGroup.h
 *  libavid
 *
 *  Created by Peter on 24.02.12.
 *  Copyright 2012 __MyCompanyName__. All rights reserved.
 *
 */

#ifndef A_TRACK_GROUP_H
#define A_TRACK_GROUP_H

#include "AComponent.h"
#include <vector>

// Version: 8 (MC 7 old versioning scheme to MC 5.03)
// AComposition is derived from this
class ATrackGroup : public AComponent
{
	
public:
	
	struct Track
	{
		// These are OMF 'TRAK' elements
		Int16  _optFlags;    // 5
		Int16  _labelNumber; // 2
		UInt32 _trackComponent; // 0x000001C5, probably an AComponent*, or a TRKR
		
		// This is actually stored in a PClass extension
		// that comes after the main data of the chunk, but we might as well
		// put it in here.
		Int16 _lockNumber; //0
	};
	
	A_DECLARE_CLASS( 'TRKG', ATrackGroup, AComponent );
	
	virtual void readFromStream( AStream& str, const AObjDoc& objd );
	virtual void dump( std::ostream& str ) const;
	
	typedef std::vector< Track* > TrackList;
	
	// Most of these are OMF TRKG
	Int8  _mode; // 0
	Int32 _groupLength; // 3000/2877/720
	Int32 _numScalars;  // 0
	// Int32 _numTracks;   // 1; Don't need this in here since the _tracks.size() gives us that value
	TrackList _tracks; // Vector since a list doesn't allow access by index
	
};

#endif /*Inclusion Guard*/